<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVehicleInfosTable extends Migration
{
  /**
   * 车辆信息
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    Schema::create('vehicle_info', function (Blueprint $table) {
      $table->increments('id');
      $table->unsignedSmallInteger('member_id')->nullable()->comment('会员ID');
      $table->string('plateNumber', 15)->comment('车牌号');
      $table->unsignedSmallInteger('car_brand_id')->comment('车辆品牌');
      $table->unsignedSmallInteger('color_id')->comment('车辆颜色');
      $table->string('vin', 100)->nullable()->comment('车辆识别码');
      $table->string('engineType', 100)->nullable()->comment('车辆发动机型号');
      $table->string('transmissionType', 100)->nullable()->comment('车辆变速箱型号');
      $table->string('buyCarDate', 50)->nullable()->comment('车辆购车日期');
      $table->string('annualReviewDate', 50)->nullable()->comment('车辆年审日期');
      $table->unsignedSmallInteger('carNature')->default(1)->comment('车辆性质 1私车 2公车 3公务车');
      $table->text('msg')->nullable()->comment('备注信息');
      $table->timestamps();
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    Schema::dropIfExists('vehicle_info');
  }
}
